package com.lingnan.tijian.utils;

public class ThreadLocalUtil {

    public static final ThreadLocal threadLocal = new ThreadLocal<>();

    //根据键获取值
    public static <T> T get(){
        return (T) threadLocal.get();
    }

    //set方法
    public static void set(Object value) {
        threadLocal.set(value);
    }

    public static void remove() {
        threadLocal.remove();
    }


//    public static void setCurrentId(Long id) {
//        threadLocal.set(id);
//    }
//
//    public static Long getCurrentId() {
//        return threadLocal.get();
//    }
//
//    public static void removeCurrentId() {
//        threadLocal.remove();
//    }

}
